package com.edusci.backend.controller;


import com.edusci.backend.pojo.Activity;
import com.edusci.backend.pojo.Course;
import com.edusci.backend.service.IActivityService;
import com.edusci.backend.utils.CourseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Lungcen
 * @since 2024-04-24
 */
@Controller
@RequestMapping("/events")
public class ActivityController {

    @Autowired
    private IActivityService activityService;

    @GetMapping("single/{id}")
    public String about(@PathVariable int id, Model model){
        Activity activity = activityService.getById(id);
        System.out.println(activity);
        model.addAttribute("activity", activity);
        return "/user/event-single";
    }
}
